import request from '@/utils/request.js'

// 登录
export const loginApi = (data) => request({ url: `/portalLogin`, method: 'post', data })

// 获取登录用户信息
export const getCustomerInfoApi = (data) => request({ url: `/getCustomerInfo`, method: 'post', data })

//注册
export const registerApi = (data) => request({ url: `/web/register/add`, method: 'post', data, loading: true })

//查询注册类型选项
export const listOption = (data) => request({ url: `/web/register/listOption`, method: 'get', data })

//获取验证码
export const captchaImage = (data) => request({ url: `/commonCaptchaImage`, method: 'get', data })

export const getCode = (params) => request({ url: `/captchaEmailForRegister`, method: 'get', params })

//获取验证码（邮箱）
export const captchaEmailApi = (params) => request({ url: `/captchaEmail`, method: 'get', params, loading: true })

// 忘记密码
export const forgotPasswordApi = (data) => request({ url: `/forgotPassword`, method: 'post', data, loading: true })

//企业选择
export const getEnterpriseList = (params) => request({ url: `/web/enterprise/listAll`, method: 'get', params })

//获取优秀企业
export const queryShowHomeEnterpriseApi = (params) => request({ url: `/web/enterprise/queryShowHomeEnterprise`, method: 'get', params })

//合作伙伴列表
export const getPartnersPageListApi = (type, params) => request({ url: `/web/enterprise/getPartnersPageList/${type}`, method: 'get', params })

// 退出登录
export const portalLogoutApi = (data) => request({ url: `/portalLogout`, method: 'post', data })